<?php
$GLOBALS['Md'] = "Exchange";
$GLOBALS['Pd'] = "B";
require_once($_SERVER['DOCUMENT_ROOT']."/defaultconf.mex");
MYTCONN();
include("main.obj.mex");
include("nav.views.mex");

	if (!isset($_POST['Time'])) {
		$_POST['Time'] = date("Y-m-01");
		$_POST['TimeEnd'] = date("Y-m-d");
	}
	if (!isset($_POST['RateStart'])) {
		$_POST['RateStart'] = 0.0000;
		$_POST['RateEnd'] = 0.0000;
	}
	if (!isset($_POST['Offices'])) {
		$_POST['Offices'] = '';
	}
	if (!isset($_POST['Curr'])) {
		$_POST['Curr'] = '';
	}
	if (!isset($_POST['CurrIn'])) {
		$_POST['CurrIn'] = '';
	}
	if (!isset($_POST['ExcStatus'])) {
		$_POST['ExcStatus'] = '';
	}
	

form_pr('PostSell','',$GLOBALS['URL'].'Lib/rs_console.mex','post'); ?>
<table width="100%"  border="0" cellpadding="3" cellspacing="1">
        <tr bgcolor="#E1E1E1">
          <td colspan="2" bgcolor="#E1E1E1"><strong>Consulta de Opera&ccedil;&otilde;es</strong></td>
          </tr>
        <tr bgcolor="#F2F2F2">
          <td rowspan="3">Moeda: <?php
		$Qur = "SELECT miso_Cod_elite AS ID, miso_ID AS NAME FROM hd_monedasiso WHERE miso_Cod_elite > 0";
		mn_field('select','ED','Curr',$_POST['Curr'],$Qur,'','',''); ?> X  <?php
		$Qur = "SELECT miso_Cod_elite AS ID, miso_ID AS NAME FROM hd_monedasiso WHERE miso_Cod_elite > 0";
		mn_field('select','ED','CurrIn',$_POST['CurrIn'],$Qur,' ','',''); ?>
        Lojas: <?php
		$Qur = "SELECT ref AS ID, name AS NAME FROM systemoffice.main_offices WHERE Type = 1";
		mn_field('select','ED','Offices',$_POST['Offices'],$Qur,'Todas','',''); ?>
        Estado: <?php
		$Qur = "SELECT ID AS ID, NAME AS NAME FROM exchange_status";
		mn_field('select','ED','ExcStatus',$_POST['ExcStatus'],$Qur,'Todos','',''); ?> Tipo:    

    
        <select name="select">
          <option value="ref">Opera��o</option>
          <option value="malote">Lote</option>
          <option value="dep_ref">Deposito</option>
          <option value="profit_ref">Venda</option>
        </select></td>
          <td>De
		  <?php
		  mn_field('date','ED','Time',$_POST['Time'],'10','8','','');
		  echo ' a ';
		  mn_field('date','ED','TimeEnd',$_POST['TimeEnd'],'10','8','',''); ?></td>
  </tr>
        <tr bgcolor="#F2F2F2">
          <td>C&acirc;mbio: Entre
		  <?php
		    mn_field('text','ED','RateStart',$_POST['RateStart'],'10','4','','');
			echo ' e ';
			mn_field('text','ED','RateEnd',$_POST['RateEnd'],'10','4','',''); ?></td>
          </tr>
        <tr bgcolor="#F2F2F2">
          <td>
		  <?php 
		  mn_field('button','ED','List','Consultar','','','','" onClick="document.PostSell.action=\''.$GLOBALS['URL'].'Lib/list_console.mex\';subform(\'PostSell\',\'LOS\');'); 
		  mn_field('button','ED','List','Imprimir','','','','" onClick="printdiv(\'LOS\');'); ?></td>
          </tr>
</table>
<table width="100%"  border="0" cellpadding="1" cellspacing="3" bgcolor="#D3E9BC">
    <tr>
      <td bgcolor="#FFFFFF">
	  <DIV id="Properties"></DIV>
	  <DIV id="Result"><?php include('Lib/rs_console.mex'); ?></DIV></td>
    </tr>
    <tr>
      <td bgcolor="#FFFFFF"><DIV id="LOS"><?php include('Lib/list_console.mex'); ?></DIV></td>
    </tr>
  </table>
</form>